package org.fastsyncer.parser;

import org.fastsyncer.connector.config.Filter;
import org.fastsyncer.connector.config.Table;
import org.fastsyncer.parser.convert.FieldConvert;
import org.fastsyncer.plugin.config.Plugin;

import java.util.List;
import java.util.Map;

/**
 * @author AE86
 * @version 2.0.0
 * @date 2019/10/15 23:56
 */
public class TableGroup {

    // 表关系ID
    private String id;

    // 数据源表
    private Table sourceTable;

    // 目标源表
    private Table targetTable;

    // 执行命令，例SQL等
    private Map<String, String> command;

    // 过滤条件
    private Filter filter;

    // 字段转换
    private List<FieldConvert> fieldConvert;

    // 插件策略
    private Plugin plugin;

    public String getId() {
        return id;
    }

    public TableGroup setId(String id) {
        this.id = id;
        return this;
    }

    public Table getSourceTable() {
        return sourceTable;
    }

    public TableGroup setSourceTable(Table sourceTable) {
        this.sourceTable = sourceTable;
        return this;
    }

    public Table getTargetTable() {
        return targetTable;
    }

    public TableGroup setTargetTable(Table targetTable) {
        this.targetTable = targetTable;
        return this;
    }

    public Map<String, String> getCommand() {
        return command;
    }

    public TableGroup setCommand(Map<String, String> command) {
        this.command = command;
        return this;
    }

    public Filter getFilter() {
        return filter;
    }

    public TableGroup setFilter(Filter filter) {
        this.filter = filter;
        return this;
    }

    public List<FieldConvert> getFieldConvert() {
        return fieldConvert;
    }

    public TableGroup setFieldConvert(List<FieldConvert> fieldConvert) {
        this.fieldConvert = fieldConvert;
        return this;
    }

    public Plugin getPlugin() {
        return plugin;
    }

    public TableGroup setPlugin(Plugin plugin) {
        this.plugin = plugin;
        return this;
    }
}
